#ifndef ENGINEUTILITY_H
#define ENGINEUTILITY_H

//==========================================================
//Enable DirectX Debugging
//==========================================================
#if defined(DEBUG) | defined(DEBUG)
#ifndef D3D_DEBUG_INFO
#define D3D_DEBUG_INFO
#endif
#endif

//==========================================================
//Include files for the project
//==========================================================
#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <DxErr.h>
#include <iostream>
#include <string>
#include <sstream>

//==========================================================
//Global Constants
//==========================================================
class Application;
class cGraphics;
class cInput;
class cAudio;
class Assets;
extern Application		*g_pD3DApp;
extern IDirect3DDevice9	*g_pD3DDevice;
extern cGraphics		*g_pGraphics;
extern cInput			*g_pDInput;
extern cAudio			*g_pAudio;
extern Assets			*g_pAssets;

//==========================================================
//Release COM Function to assist with freeing space
//==========================================================
#define SAFE_RELEASE(x) if(x){ x->Release(); x = 0; }

//==========================================================
// Information on Debugging Application
//==========================================================
#if defined(DEBUG) | defined(_DEBUG)
	#ifndef HR
	#define HR(x){ HRESULT hr = x; if(FAILED(hr)) { DXTrace(__FILE__, __LINE__, hr, #x, TRUE); } }
	#endif

#else
	#ifndef HR
	#define HR(x) x;
	#endif
#endif

#endif